<template>
  <loading-text v-if="loading"></loading-text>
  <div class="form-list" v-else>
    <div class="form-list-item">
      <div class="label">姓名</div>
      <div class="content">{{detail.aac003 || '--'}}</div>
    </div>
    <div class="form-list-item">
      <div class="label">档案号</div>
      <div class="content">{{detail.archiveCode || '--'}}</div>
    </div>
    <div class="form-list-item">
      <div class="label">身份证号</div>
      <div class="content">{{detail.aac002 || '--'}}</div>
    </div>
    <div class="form-list-item">
      <div class="label">借出单位</div>
      <div class="content">{{detail.checkoutCorp || '--'}}</div>
    </div>
    <div class="form-list-item">
      <div class="label">借出原因</div>
      <div class="content">{{detail.checkoutReason || '--'}}</div>
    </div>
    <div class="form-list-item">
      <div class="label">借阅者姓名</div>
      <div class="content">{{detail.checkoutPerson || '--'}}</div>
    </div>
    <div class="form-list-item">
      <div class="label">联系电话</div>
      <div class="content">{{detail.mobilePhone || '--'}}</div>
    </div>
    <div class="form-list-item">
      <div class="label">借出日期</div>
      <div class="content">{{detail.checkoutDate || '--'}}</div>
    </div>
    <div class="form-list-item">
      <div class="label">借至日期</div>
      <div class="content">{{detail.checkoutPeriodDate || '--'}}</div>
    </div>
    <div class="form-list-item">
      <div class="label">备注</div>
      <div class="content">{{detail.remark || '--'}}</div>
    </div>
    <yd-lightbox :num="detail.attachmentList.length">
      <div class="form-list-item" v-for="(val, key) in detail.attachmentList" :key="key">
        <div class="label">{{val.fileName}}</div>
        <div class="content">
          <yd-lightbox-img :src="$getImg(val.filePath)" class="img"></yd-lightbox-img>
        </div>
      </div>
    </yd-lightbox>
  </div>
</template>

<script>
  import LoadingText from '../../../components/loading-text/loading-text'
  export default {
    name: 'detail-borrow',
    components: {LoadingText},
    data() {
      return {
        loading: true,
        detail: {}
      }
    },
    methods: {
      getDetail() {
        this.$post('/admin/person/sapi/personal/records/file/save/loan/apply/status', {
          fileNo: this.$route.query.id
        }, loading => { this.loading = loading }).then(res => {
          this.detail = res.data.checkoutPreauditForm
        })
      }
    },
    created() {
      this.getDetail()
    }
  }
</script>

<style scoped lang="scss">
  .img{
    width: 2.5rem;
  }
</style>
